<template>
  <SelectDialog
    ref="dialogRef"
    :title="title"
    :request-api="postApi.list"
    :columns="columns"
    @submit="handleSubmit"
    row-key="id"
    row-name="postName"
  ></SelectDialog>
</template>

<script setup lang="ts" name="PostSelectDialog">
import { ref, defineEmits } from "vue";
import postApi from "@/views/system/post/api";
import SelectDialog from "../SelectDialog/index.vue";
import { ColumnProps } from "@/components/Table/type";
const title = ref("岗位选择");
const dialogRef = ref();
const emit = defineEmits(["submit"]);
const handleSubmit = selectedList => {
  emit("submit", selectedList);
};
const columns: ColumnProps[] = [
  { prop: "postCode", label: "岗位编码" },
  { prop: "postName", label: "岗位名称", search: { el: "input" } }
];
const open = () => {
  dialogRef.value.open();
};
defineExpose({ open });
</script>

<style scoped></style>
